From: Keir Fraser Date: Mon, 21 Jun 2010 08:59:10 +0000 (+0100) Subject: vmx: Fix bug in VMX VPMU fixed function PMC offset X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11900 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=154a413090645bac5ba4587999484e41088f3f89;p=xen.git vmx: Fix bug in VMX VPMU fixed function PMC offset This is a minor fix to the calculation of bit-width of fixed function perfmon counters in Intel processors. Bits 5-12 of edx register should be calculated as (edx & 0x1fe0) >>5 instead of using 0x1f70. From: "John, Jaiber J" Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c index 4646600ca4..ce4fd2d43e 100644 --- a/xen/arch/x86/hvm/vmx/vpmu_core2.c +++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c @@ -83,7 +83,7 @@ static int core2_get_bitwidth_fix_count(void) { u32 eax, ebx, ecx, edx; cpuid(0xa, &eax, &ebx, &ecx, &edx); - return ((edx & 0x1f70) >> 5); + return ((edx & 0x1fe0) >> 5); } static int is_core2_vpmu_msr(u32 msr_index, int *type, int *index)